home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
038a
/
bas_int1.zip
/
PRINTER.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-05-28
|
1KB
|
40 lines
'===================================================================
' Quick Basic Forum
' Date : 13-May-91
' From : David Rice
'Subject : printer status; error messages
'=================================================================
err.code% = 1
call printer.check(err.code%)
'
' Snibbit by Robert Campbell.
' sub-program : printer.check(err.code%)
' purpose : check the status of the printer and return any errors
' inputerr.code% : the line printer port to be tested (lpt1 = 1)
' output err.code% : returns 0 if printer is ready
' err.code% = 8 Printer I/O Error
' err.code% = 32 The Printer is Out Of Paper
' err.code% = 16 The Printer is Off Line
'
sub printer.check(err.code%) static
defint a-z
if err.code% = 0 then err.code% = 1
dim inary%(7),outary%(7)
inary%(0) = &h0200
inary%(3) = err.code% - 1
err.code% = 0
call int86(23,varptr(inary%(0)),varptr(outary%(0)))
err.code% = 1
a = outary%(0)
a = (a / 256) and 255
if a = &h90 then err.code% = 0
if (a and &h8) = 8 then err.code% = 8 'Printer I/O Error
if (a and &h20) = 32 then err.code% = 32 'The Printer is Out Of Paper
if (a and &h10) = 0 then err.code% = 16 'The Printer is Off Line
end sub